1. Import Python Packages


In [1]:
%matplotlib notebook
import metatlas.helpers.pactolus_tools
import pandas as pd

2. View Pactolus Data

There are a few variables that you need to know about:

Mandatory:

  • path_loc is the directory to which your raw data is being held. This will get updated later so it will not be needed but this is the work around.
  • pkl is the pickle file that the pactolus hits are wrapped in.

In [6]:
# Replace these variables with what you need.
path_loc = '/project/projectdirs/metatlas/raw_data/kblouie/20170222_KBL_C18_MO_Fungus11mL/'
pkl = 'pactolus_hits.pkl'

Optional variables to fill:

  • index is the row of the dataframe that pactolus plotter will be looking at. In the future, this will be updated so that you don't have to modify and run every single time.
  • quantile refers to whether or not you wish to search for peaks by quantile. Setting it to False means PactolusPlotter will grab the top nlarge peaks.
  • quantile_param is the quantile that you want to filter by. Leave this alone if you set quantile to False.
  • nlarge is the amount of top peaks you want to grab. Leave this alone if you set quantile to True.

In [7]:
index = 0
quantile = True
quantile_param = .85
nlarge = 10

Reads the pickle and parse the data given the parameters passed in.

The plotter allows for you to filter substructures by depth of the hit and neutralization through convienent widgets. Basic information about the particular hit like score, polarity, and retention time is displayed at the top. In addition, you can visualize the substructures found at a peak with their respective depths if you select a peak. PactolusPlotter allows for selecting multiple peaks albeit not in a clean way.


In [ ]:
df = pd.read_pickle(pkl)
pac_data = PactolusPlotter(df, path_loc, index, quantile, quantile_param, nlarge)

If you want to see all the data from the pactolus hits file, run the block below. It usually takes about 30 seconds for it to complete.


In [ ]:
df_stripped = df[["polarity", "precursor intensity", "precursor_mz",
       "retention_time", "score", "inchi", "inchi_key"]].copy()
compound_grid = qgrid.QGridWidget(df=df_stripped)#,set_grid_option={'show_toolbar',True})
compound_grid.export()